

# l0 = [1, 2, 3, 4, 5]
# # 等号赋值
# l2 = l0
#
# print(id(l0), id(l2))
#
# l0.append(6)
# print(l0, l2)


import copy
d0 = {
    "name": "张三",
    "addr": []
}
d1 = d0
print(d0)
print(d1)
# d0["age"] = 20
# print("#"*20)
# print(d0)
# print(d1)


print("#"*20)
d2 = copy.copy(d0)
d0["sex"] = "男"
print(d0)
print(d2)
d0["addr"].append(3)
print("#"*20)
print(d0)
print(d2)
print(id(d0),id(d2))
print(id(d0['addr']),id(d2['addr']))
#
# print("#"*20)
# d3 = copy.deepcopy(d0)
# d0["id"] = "101"
# print(d0)
# print(d3)
# d0["addr"].append(3)
# print(d0)
# print(d3)
# print(id(d0),id(d3))
